package com.exam.service.impl;

import com.exam.mapper.ScoreMapper;
import com.exam.mapper.TeacherMapper;
import com.exam.po.Score;
import com.exam.service.UStudentService;
import com.exam.ustudent.UStudent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author zhanghui
 * @ClassName UStudentServiceImpl
 * @Description TODO
 * @Date 2021/1/12 11:24
 * @Version 1.0
 **/
@Service
public class UStudentServiceImpl implements UStudentService {
    @Autowired
    private TeacherMapper teacherMapper;
    @Autowired
    private ScoreMapper scoreMapper;
    /**
     * @Author zhanghui
     * @Description 查询学生成绩
     * @Date 2021/1/12 11:25
     * @Param [teacherId, page, size]
     * @return java.util.List<com.exam.ustudent.UStudent>
     **/
    public List<UStudent> findStudentScore(Integer teacherId, Integer page, Integer size) {
        return teacherMapper.selectStudentScore(teacherId,(page-1)*size,size);
    }

    @Override
    public int updateScoreStatus(Score score) {
        return scoreMapper.updateScoreStatus(score);
    }

    @Override
    public int findStudentScoreCount(Integer teacherId) {
        return teacherMapper.selectStudentScoreCount(teacherId);
    }
}
